package ${provider};

import ${api}.${table.alias}Api;
import ${service}.${table.alias}Service;
import com.fingard.gardpay.common.bean.PageView;
import com.fingard.gardpay.common.bean.ResultContext;
import com.fingard.gardpay.common.export.ExportParam;
import ${dTO}.${table.alias}DTO;
import ${param}.${table.alias}Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hutool.core.lang.Assert;
import java.util.List;

/**
 * @author ${author}
 * @version 1.0 ${date}
 */
@Service
public class ${table.alias}Provider implements ${table.alias}Api {

    private final ${table.alias}Service ${table.propertyName}Service;

    @Autowired
    public ${table.alias}Provider(${table.alias}Service ${table.propertyName}Service) {
        this.${table.propertyName}Service = ${table.propertyName}Service;
    }

    @Override
    public PageView<${table.alias}DTO> listPage(${table.alias}Param ${table.propertyName}Param) {
        return ${table.propertyName}Service.listPage(${table.propertyName}Param);
    }

   @Override
   public ResultContext<${table.alias}DTO> getById(String urid) {
        Assert.notBlank(urid, "传入的ID不能为空！");
       return ${table.propertyName}Service.getById(urid);
   }

   @Override
   public ResultContext<${table.alias}DTO> add(${table.alias}DTO ${table.propertyName}DTO) {
       return ${table.propertyName}Service.insert(${table.propertyName}DTO);
   }

    @Override
    public ResultContext<Integer> delete(List<String> uridList) {
        Assert.notEmpty(uridList, "传入的ID列表不能为空！");
        return ${table.propertyName}Service.delete(uridList);
    }

   @Override
   public ResultContext<${table.alias}DTO> edit(${table.alias}DTO ${table.propertyName}DTO) {
       return ${table.propertyName}Service.update(${table.propertyName}DTO);
   }

   @Override
   public ResultContext<ExportParam> export(${table.alias}Param ${table.propertyName}Param, ExportParam exportParam) {
       return ${table.propertyName}Service.export(${table.propertyName}Param, exportParam);
   }
}
